<?php
//预下单回调
$param = file_get_contents('php://input');
file_put_contents('create_order_callback_url.json', $param);
$param = json_decode($param, true);
if (!empty($param['msg'])) {
    $out_order_no = 'LD' . time() . uniqid();
    $msg = $param['msg'];
    $msg = json_decode($msg, true);
    // var_dump($msg['goods'][0]['item_order_id_list'][0]);
    // exit;
    $item_order_id = $msg['goods'][0]['item_order_id_list'][0];
    echo json_encode([
        'err_no' => 0,
        'err_tips' => 'success',
        'data' => [
            "out_order_no" => $out_order_no,//随机字符串函数 
            "pay_expire_seconds" => 300,
            "order_entry_schema" => [

                "path" => "pages/user/index" //订单详情页跳转路径
            ],
            "order_goods_info" => [
                [
                    "goods_id" => $msg['goods'][0]['goods_id'],

                ]
            ]

        ],

    ]);
} else {
    echo json_encode([
        'err_no' => 1,
        'err_tips' => 'fail',

    ]);
}



exit;